package com.maiikun.thread_pool.reject;

import com.maiikun.thread_pool.MyThreadPool;

/**
 * 丢弃最旧任务，尝试重新提交当前任务
 */
public class DiscardOldestPolicy implements RejectHandle{
    @Override
    public void reject(Runnable command, MyThreadPool threadPool) {
        threadPool.commandList.poll();
        threadPool.execute(command);
    }
}
